package cn.et.ceshi.service.impl;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import cn.et.ceshi.entity.FoodExample;
import cn.et.ceshi.mapper.FoodMapper;
import cn.et.ceshi.service.LuceService;
@Service
public class LuceServiceImpl implements LuceService{
	@Autowired
	JdbcTemplate jdbc;
	@Autowired
	FoodMapper fm;
	//获取Food表的所有数据
	public List<Map<String, Object>> query(int start,int rows) {
		String sql="select * from food limit "+start+","+rows;
		return jdbc.queryForList(sql);
		 
	}
	//获取所有的总行数
	public int queryFoodCount(){
		FoodExample fe= new FoodExample();
		return (int) fm.countByExample(fe);
	}

}
